package com.ykzb.base.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;


@Configuration
public class WebConfig {

    /**
     * 配置属性
     * @return
     */
    @Bean(name = {"propertyConfigurer"})
    public CustomPropertyPlaceholderConfigurer getPropertyConfigurer() {
        CustomPropertyPlaceholderConfigurer propertyConfigurer = new CustomPropertyPlaceholderConfigurer();
        Resource[] resources = new Resource[]{
                new ClassPathResource("config\\properties\\sms.properties"),
                new ClassPathResource("config\\properties\\redis-cluster.properties")
        };
        propertyConfigurer.setLocations(resources);
        propertyConfigurer.setFileEncoding("UTF-8");
        return propertyConfigurer;
    }

}
